
export function debounce (fn:Function,delay:number){
    let timer:number|null =null
    return function (...args:any[]){
         if(timer) clearTimeout(timer)
            const that:any = this as any
        timer = setTimeout(()=>{
            fn.apply(that,args) 
        },delay)
    }

}